#include "vcl_stl.h"

#include "bkbase.h"
#include "bkipc.h"
#include "bstcp.h"

#include "h_base.h"
#include "h_xml.h"
using namespace h_base;

static void JsonGetTag(const char *Begin, const HString &Tag, HString &Value)
{
   const char *s;
   char TagStr[500 + 1];

   Value = "";
   snprintf(TagStr, 500, "\"%s\":", Tag.c_str());
   s = strstr(Begin, TagStr);

   if ( s == NULL )
   {
      return;
   }

   for ( s += strlen(TagStr); *s == ' '; s++ )
      ;

   if ( *s == '"' )
   {
      s++;
      const char *Word = s;
      for ( ; *s != '\0' && *s != '"'; s++ )
         ;
      Value = HString(Word, s - Word);
   }
   else
   {
      const char *Word = s;
      for ( ; *s != '\0' && *s != ',' && *s != '}' && *s != '"'; s++ )
         ;
      Value = HString(Word, s - Word);
   }
}

struct aaa
{
   char c1;
   char c2;
   struct
   {
      char c3;
      char c4;
   };
   union
   {
      char c5;
      char c6;
   };
   char c7;
} a;

int main(int argc, char *argv[])
{
   memset(&a, ' ', sizeof(a));
   a.c3 = '3';
   a.c5 = '5';
   a.c7 = '7';
   BkMemDump(stderr, &a, sizeof(a));
   return 0;
}
